<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>项目管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
    <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
    <style type="text/css">

        /* tooltip */
        #tooltip{
            position:absolute;
            border:1px solid #ccc;
            background:#333;
            padding:2px;
            display:none;
            color:#fff;
        }
        .multiSelect-user {
            width: auto !important;
        }
        .multiSelect-user .multiSelect{
            min-height: 31px;
            margin-top: -31px;
        }
    </style>
</head>
<body style="padding:10px;">
<div class="tplay-body-div">
    {include file="project/project_tab"}
    <form class="layui-form serch" action="{:url('admin/project/index')}" method="get">
        <div class="layui-form-item" style="float: left;">

            <div class="layui-input-inline">
                <div class="layui-inline">
                    <select name="project_type" lay-search="">
                        <option value="">请选择项目类型</option>
                        {volist name="projetcTypeName" id="po"}
                        <option value="{$key}" {notempty name="$project_type"}{eq name="$project_type" value="$key"} selected=""{/eq}{/notempty}>{$po}</option>
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="layui-input-inline multiSelect-user">
                <div class="layui-inline">
                    <select name="project_stage[]" size="7" multiple="">
                        <option value="">请选择项目阶段</option>
                        {foreach $projectStageName as $p=>$ps}
                        <option value="{$p}" {notempty name="$project_stage"}
                                <?php echo in_array($p,$project_stage)?'selected':''; ?>
                        {/notempty}>{$ps}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="layui-input-inline">
                <div class="layui-inline">
                    <select name="project_status" lay-search="">
                        <option value="">请选择项目状态</option>
                        {foreach $projectStatusName as $p=>$ps}
                        <option value="{$p}" {notempty name="$project_status"}{eq name="$project_status" value="$p"} selected=""{/eq}{/notempty}>{$ps}</option>
                        {/foreach}
                    </select>
                </div>
            </div>

            <button class="layui-btn layui-btn-sm" type="submit" lay-filter="serch">查询</button>
        </div>
    </form>

    <table class="layui-table" lay-size="sm">
        <thead>
        <tr>
            <th>ID</th>
            <th>项目名称</th>
            <th>优先级
                <span class="layui-table-sort layui-inline" {if condition="$sortWhere.project_level_sort eq 1"}lay-sort="asc"{elseif condition="$sortWhere.project_level_sort eq 2" /} lay-sort="desc" {/if}>
                    <a href="{:url('admin/project/index',['project_level_sort'=>1,'project_type'=>$project_type,'project_status'=>$project_status])}"><i class="layui-edge layui-table-sort-asc" title="升序"></i></a>
                    <a href="{:url('admin/project/index',['project_level_sort'=>2,'project_type'=>$project_type,'project_status'=>$project_status])}"><i class="layui-edge layui-table-sort-desc" title="降序"></i></a>
                </span>
            </th>
            <th>进度
                <span class="layui-table-sort layui-inline" {if condition="$sortWhere.project_speed_sort eq 1"}lay-sort="asc"{elseif condition="$sortWhere.project_speed_sort eq 2" /} lay-sort="desc" {/if}>
                    <a href="{:url('admin/project/index',['project_speed_sort'=>1,'project_type'=>$project_type,'project_status'=>$project_status])}"><i class="layui-edge layui-table-sort-asc" title="升序"></i></a>
                    <a href="{:url('admin/project/index',['project_speed_sort'=>2,'project_type'=>$project_type,'project_status'=>$project_status])}"><i class="layui-edge layui-table-sort-desc" title="降序"></i></a>
                </span>
            </th>
            <th>项目类型
                <span class="layui-table-sort layui-inline" {if condition="$sortWhere.project_type_sort eq 1"}lay-sort="asc"{elseif condition="$sortWhere.project_type_sort eq 2" /} lay-sort="desc" {/if}>
                    <a href="{:url('admin/project/index',['project_type_sort'=>1,'project_type'=>$project_type,'project_status'=>$project_status])}"><i class="layui-edge layui-table-sort-asc" title="升序"></i></a>
                    <a href="{:url('admin/project/index',['project_type_sort'=>2,'project_type'=>$project_type,'project_status'=>$project_status])}"><i class="layui-edge layui-table-sort-desc" title="降序"></i></a>
                </span>
            </th>
            <th>当前阶段
                <span class="layui-table-sort layui-inline" {if condition="$sortWhere.current_stage_sort eq 1"}lay-sort="asc"{elseif condition="$sortWhere.current_stage_sort eq 2" /} lay-sort="desc" {/if}>
                    <a href="{:url('admin/project/index',['current_stage_sort'=>1,'project_type'=>$project_type,'project_status'=>$project_status])}"><i class="layui-edge layui-table-sort-asc" title="升序"></i></a>
                    <a href="{:url('admin/project/index',['current_stage_sort'=>2,'project_type'=>$project_type,'project_status'=>$project_status])}"><i class="layui-edge layui-table-sort-desc" title="降序"></i></a>
                </span>
            </th>
            <th>项目状态
                <span class="layui-table-sort layui-inline" {if condition="$sortWhere.project_status_sort eq 1"}lay-sort="asc"{elseif condition="$sortWhere.project_status_sort eq 2" /} lay-sort="desc" {/if}>
                <a href="{:url('admin/project/index',['project_status_sort'=>1,'project_type'=>$project_type,'project_status'=>$project_status])}"><i class="layui-edge layui-table-sort-asc" title="升序"></i></a>
                <a href="{:url('admin/project/index',['project_status_sort'=>2,'project_type'=>$project_type,'project_status'=>$project_status])}"><i class="layui-edge layui-table-sort-desc" title="降序"></i></a>
                </span>
            </th>
            <th>开始时间</th>
            <th>预估完成时间</th>
            <th>预估天数</th>
            <th>项目经理
                <span class="layui-table-sort layui-inline" {if condition="$sortWhere.project_manager_id_sort eq 1"}lay-sort="asc"{elseif condition="$sortWhere.project_manager_id_sort eq 2" /} lay-sort="desc" {/if}>
                    <a href="{:url('admin/project/index',['project_manager_id_sort'=>1,'project_type'=>$project_type,'project_status'=>$project_status])}"><i class="layui-edge layui-table-sort-asc" title="升序"></i></a>
                    <a href="{:url('admin/project/index',['project_manager_id_sort'=>2,'project_type'=>$project_type,'project_status'=>$project_status])}"><i class="layui-edge layui-table-sort-desc" title="降序"></i></a>
                </span>
            </th>
            <th>需求方</th>

            <th>关联jira</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="project" id="vo"}
        <tr>
            <td>{$vo.project_id}</td>
            <td><a href="{:url('admin/task/index',['project_id'=>$vo.project_id])}" style="text-decoration: underline; color: #009688; cursor: pointer;">{$vo.project_name}</a></td>
            <td>
                {$projectLevelMap[$vo.project_level]}
            </td>
            <td>{$vo.project_speed}%</td>
            <td>
                {$projetcTypeName[$vo.project_type]}
            </td>
            <td>
                {$projectStageName[$vo.current_stage]}
            </td>
            <td>
                {$projectStatusName[$vo.project_status]}
            </td>
            <td>{$vo.begin_time|date="Y-m-d",###}</td>
            <td>{$vo.estimate_time|date="Y-m-d",###}</td>
            <td>{$vo.estimate_day}</td>
            <td>{$vo.project_manager_name}</td>
            <td>{$vo.demand_person}</td>
           <!-- <td>{$vo.jira_id}</td>-->
            <td><a href="{:url('/',['browse'=>$vo.jira_id],'','jira.corp.yljr.com')}" target="_blank" style="text-decoration: none;cursor: pointer;">{$vo.jira_id}</a></td>

            <td class="operation-menu">
                <div class="layui-btn-group">
                    <a href="{:url('admin/project/publish',['project_id'=>$vo.project_id])}" class="layui-btn layui-btn-xs a_menu layui-btn-primary" id="{$vo.project_id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
                    <a href="{:url('admin/task/index',['project_id'=>$vo.project_id])}" class="layui-btn layui-btn-xs a_menu layui-btn-primary" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
                    <a href="javascript:;" class="layui-btn layui-btn-xs layui-btn-primary delete" delete_id="{$vo.project_id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
                </div>
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div class="pagination-box">{$page}</div>
<!--    <div style="padding:0 20px;">{//$project->render()}</div>-->
    {include file="public/foot"}
    <script type="text/javascript">
        $('.delete').click(function(){
            var id = $(this).attr('delete_id');
            layer.confirm('确定要删除?', function (index) {
                $.ajax({
                    url: "{:url('admin/project/delete')}",
                    data: {id: id},
                    success: function (res) {
                        layer.msg(res.msg);
                        setTimeout(function () {
                            window.location.reload();
                        }, 1500)
                    },
                    error: function (err) {
                        console.error('err', err)
                    }
                })
            })
        })
    </script>
</div>
</body>
</html>
